﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NS_QuangCaoTiepThi.QCTT.User
{
    public partial class User : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["MaNguoiDung"] == null || Session["MaNguoiDung"].ToString() == string.Empty)
            {
                lblMaNguoiDung.Text = ".....";

                Response.Redirect("~/Index.aspx");
            }
            else
            {
                lblMaNguoiDung.Text = Session["MaNguoiDung"].ToString();

                //Phan quyen
                switch (Session["MaLoaiNguoiDung"].ToString())
                {
                    case "TELLER":
                        hlnkDuyetSoanThao.Enabled = false;
                        break;

                    case "SUPERVISOR":
                        hlnkSoanThao.Enabled = false;
                        hlnkSuaNoiDungChuaDuyet.Enabled = false;
                        break;

                    default:
                        break;
                }
            }
        }

        protected void lbtnDangXuat_Click(object sender, EventArgs e)
        {
            Session.Clear();

            Response.Redirect("~/Index.aspx");
        }
    }
}